import {
	PHOTO_IMG_LIST,
} from '@/config/cache.js'

// 照片选择上传逻辑
export default {
	namespaced: true,
	state: {
		// 上传的照片
		photoImgList: uni.getStorageSync(PHOTO_IMG_LIST) || [],
	},
	mutations: {
		updatePhotoList(state, payload) {
			state.photoImgList = payload
			uni.setStorageSync(PHOTO_IMG_LIST, payload)
		},
		clearData(state) {
			state.photoImgList = []
			uni.removeStorageSync(PHOTO_IMG_LIST)
		}
	}
}